<template>
  <div>
    <!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
      <el-radio-button :label="false">展开</el-radio-button>
      <el-radio-button :label="true">收起</el-radio-button>
    </el-radio-group> -->
    <el-menu
      router
      default-active="1-4-1"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      :collapse="isCollapse"
    >
      <el-menu-item index="home">
        <i class="el-icon-eleme"></i>
        <span slot="title">首页展示</span>
      </el-menu-item>

      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span slot="title">内容展示</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="about">详情</el-menu-item>
          <el-menu-item index="mytable">表格展示</el-menu-item>
          <el-menu-item index="formTable">Form 表单</el-menu-item>
          <el-menu-item index="carousel">Carousel 走马灯</el-menu-item>
        </el-menu-item-group>
      </el-submenu>

      <el-submenu index="3">
        <template slot="title">
          <i class="el-icon-picture"></i>
          <span slot="title">Echarts图表</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="bar">柱状图</el-menu-item>
          <el-menu-item index="pie">饼图</el-menu-item>
        </el-menu-item-group>
      </el-submenu>

      <el-menu-item index="application">
        <i class="el-icon-menu"></i>
        <span slot="title">应用管理</span>
      </el-menu-item>
      <el-menu-item index="config">
        <i class="el-icon-setting"></i>
        <span slot="title">配置管理</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: false
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>
<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
</style>
